package cn.ym.ymcc.fallback;

import cn.ym.ymcc.domain.Login;
import cn.ym.ymcc.feign.LoginServerFeign;
import cn.ym.ymcc.result.JSONResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class LoginServerFeignFallback implements FallbackFactory<LoginServerFeign> {
    @Override
    public LoginServerFeign create(Throwable throwable) {
        return new LoginServerFeign() {
            @Override
            public JSONResult saveOrUpdate(Login login) {

                return  JSONResult.error("系统繁忙，请稍后再试！！！");
            }
        };
    }
}
